package classesInterface;

import classesBancodeDados.FichaHistEnfermagem;
import classesBancodeDados.Paciente;
import classesJpa.FichaHistEnfermagemJpaController;
import classesJpa.exceptions.NonexistentEntityException;
import classesMiolo.DataHorario;
import classesMiolo.Formatador;
import classesMiolo.MapasHistEnferm;
import classesMiolo.MapasPaciente;
import classesMiolo.ReverseMapper;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.JOptionPane;


public class TelaFichaHistoricoEnfermagem extends javax.swing.JFrame {

    /**
     * Creates new form HistoricoEnfermagem
     */
    private TelaFichaHistoricoEnfermagem() {
        initComponents();
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    }
    
    public static TelaFichaHistoricoEnfermagem getInstance(){
        if(instance == null) instance = new TelaFichaHistoricoEnfermagem();
        return instance;
    }
    
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jLabel11 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        campoNome = new javax.swing.JTextField();
        campoProntuário = new javax.swing.JTextField();
        campoEnfermaria = new javax.swing.JTextField();
        campoLeito = new javax.swing.JTextField();
        campoNascimento = new javax.swing.JFormattedTextField();
        campoIdade = new javax.swing.JTextField();
        comboSexo = new javax.swing.JComboBox();
        campoProcedenca = new javax.swing.JTextField();
        jSeparator2 = new javax.swing.JSeparator();
        jLabel10 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        comboSono = new javax.swing.JComboBox();
        jLabel14 = new javax.swing.JLabel();
        campoSoniferos = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        comboDieta = new javax.swing.JComboBox();
        jLabel16 = new javax.swing.JLabel();
        comboAutoCuidado = new javax.swing.JComboBox();
        jLabel17 = new javax.swing.JLabel();
        comboHigieneCorporal = new javax.swing.JComboBox();
        jLabel18 = new javax.swing.JLabel();
        comboHigieneOral = new javax.swing.JComboBox();
        jLabel19 = new javax.swing.JLabel();
        comboMovimentacao = new javax.swing.JComboBox();
        jSeparator3 = new javax.swing.JSeparator();
        jLabel20 = new javax.swing.JLabel();
        checkTabagismo = new javax.swing.JCheckBox();
        checkEtilismo = new javax.swing.JCheckBox();
        checkOutrasDrogas = new javax.swing.JCheckBox();
        campoOutrasDrogas = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        campoMedicamento = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        campoAntecedentes = new javax.swing.JTextField();
        jSeparator4 = new javax.swing.JSeparator();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        comboConsciencia = new javax.swing.JComboBox();
        comboEstadoMental = new javax.swing.JComboBox();
        comboPupilas = new javax.swing.JComboBox();
        comboInteracaoSocial = new javax.swing.JComboBox();
        comboDiscurso = new javax.swing.JComboBox();
        checkAlucinacoes = new javax.swing.JCheckBox();
        checkDelirios = new javax.swing.JCheckBox();
        campoAlucinacoes = new javax.swing.JTextField();
        campoDelirios = new javax.swing.JTextField();
        jSeparator5 = new javax.swing.JSeparator();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        campoTemperatura = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        campoPulso = new javax.swing.JTextField();
        jLabel32 = new javax.swing.JLabel();
        campoFuncaoCardiaca = new javax.swing.JTextField();
        jLabel33 = new javax.swing.JLabel();
        campoPressaoArterial = new javax.swing.JTextField();
        jLabel34 = new javax.swing.JLabel();
        comboNutricional = new javax.swing.JComboBox();
        jLabel35 = new javax.swing.JLabel();
        comboRespiratorio = new javax.swing.JComboBox();
        jLabel36 = new javax.swing.JLabel();
        comboCardiaca = new javax.swing.JComboBox();
        botaoSalvar = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        jLabel11.setText("jLabel11");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Andalus", 1, 14)); // NOI18N
        jLabel1.setText("Histórico de Enfermagem");

        jLabel2.setText("Nome:");

        jLabel3.setText("Prontuário:");

        jLabel4.setText("Enfermaria:");

        jLabel5.setText("Leito:");

        jLabel6.setText("Data de Nascimento:");

        jLabel7.setText("Procedência:");

        jLabel8.setText("Idade:");

        jLabel9.setText("Sexo:");

        campoNascimento.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                campoNascimentoKeyPressed(evt);
            }
        });

        comboSexo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Masculino", "Feminino" }));

        jLabel10.setText("Identificação do Paciente:");

        jLabel12.setText("Necessidade / Auto Cuidado:");

        jLabel13.setText("Sono e Repouso:");

        comboSono.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Satisfatório", "Prejudicado", "Insônia" }));
        comboSono.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboSonoActionPerformed(evt);
            }
        });

        jLabel14.setText("Auxiliares do Sono:");

        jLabel15.setText("Dieta:");

        comboDieta.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Preservada", "Prejudicada", "Ajuda para Alimentação", "Restrição Alimentar" }));
        comboDieta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboDietaActionPerformed(evt);
            }
        });

        jLabel16.setText("Demanda de Auto Cuidado:");

        comboAutoCuidado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Dependente", "Independente" }));
        comboAutoCuidado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboAutoCuidadoActionPerformed(evt);
            }
        });

        jLabel17.setText("Higiene Corporal:");

        comboHigieneCorporal.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Preservada", "Prejudicada" }));
        comboHigieneCorporal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboHigieneCorporalActionPerformed(evt);
            }
        });

        jLabel18.setText("Higiene Oral:");

        comboHigieneOral.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Preservada", "Prejudicada" }));
        comboHigieneOral.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboHigieneOralActionPerformed(evt);
            }
        });

        jLabel19.setText("Movimentação:");

        comboMovimentacao.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Deambula", "Não Deambula", "Contido no Leito" }));
        comboMovimentacao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboMovimentacaoActionPerformed(evt);
            }
        });

        jLabel20.setText("Fatores de Risco:");

        checkTabagismo.setText("Tabagismo");
        checkTabagismo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                checkTabagismoActionPerformed(evt);
            }
        });

        checkEtilismo.setText("Etilismo");
        checkEtilismo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                checkEtilismoActionPerformed(evt);
            }
        });

        checkOutrasDrogas.setText("Outras Drogas:");
        checkOutrasDrogas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                checkOutrasDrogasActionPerformed(evt);
            }
        });

        jLabel21.setText("Uso de Medicamentos:");

        jLabel22.setText("Antecedentes Familiares:");

        jLabel23.setText("Condições Neurológicas:");

        jLabel24.setText("Nível de Conciência:");

        jLabel25.setText("Estado Mental:");

        jLabel26.setText("Pupilas:");

        jLabel27.setText("Interação Social:");

        jLabel28.setText("Discurso:");

        comboConsciencia.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Consciente", "Obnubliada" }));
        comboConsciencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboConscienciaActionPerformed(evt);
            }
        });

        comboEstadoMental.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Orientado", "Desorientado", "Sonolento", "Calmo", "Agitado", "Ansioso", "Agressivo" }));
        comboEstadoMental.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboEstadoMentalActionPerformed(evt);
            }
        });

        comboPupilas.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Isocóricas", "Anisocóricas", "Midríase", "Miose", "Média Fixa", "Fotoreação" }));
        comboPupilas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboPupilasActionPerformed(evt);
            }
        });

        comboInteracaoSocial.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Comunicativo", "Pouco Comunicativo", "Apático" }));
        comboInteracaoSocial.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboInteracaoSocialActionPerformed(evt);
            }
        });

        comboDiscurso.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Conexo", "Desconexo", "Contínuo" }));
        comboDiscurso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboDiscursoActionPerformed(evt);
            }
        });

        checkAlucinacoes.setText("Alucinações:");
        checkAlucinacoes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                checkAlucinacoesActionPerformed(evt);
            }
        });

        checkDelirios.setText("Delírios:");
        checkDelirios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                checkDeliriosActionPerformed(evt);
            }
        });

        jLabel29.setText("Sinais Vitais e Outras Informações:");

        jLabel30.setText("Temperatura:");

        jLabel31.setText("Pulso:");

        jLabel32.setText("Pressão Arterial:");

        jLabel33.setText("Função Cardíaca:");

        jLabel34.setText("Estado Nutricional:");

        comboNutricional.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Normal", "Obeso", "Emagrecido", "Caquético", "Desnutrido", "Deshidratado" }));

        jLabel35.setText("Sistema Respiratório:");

        comboRespiratorio.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Eupnéico", "Bradipinéico", "Caquético", "Dispinéico" }));

        jLabel36.setText("Atividade Cardíaca:");

        comboCardiaca.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Regular", "Irregular" }));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
            .addComponent(jSeparator2)
            .addComponent(jSeparator3)
            .addComponent(jSeparator4, javax.swing.GroupLayout.Alignment.TRAILING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(checkTabagismo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(checkEtilismo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(checkOutrasDrogas)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(campoOutrasDrogas)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel21)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(campoMedicamento, javax.swing.GroupLayout.PREFERRED_SIZE, 402, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addComponent(jLabel1))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jLabel2)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(campoNome, javax.swing.GroupLayout.PREFERRED_SIZE, 385, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jLabel8)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(campoIdade, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel9)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(comboSexo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel6)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(campoNascimento, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jLabel5)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(campoLeito))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jLabel3)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(campoProntuário, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel4)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(campoEnfermaria))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel7)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(campoProcedenca))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel13)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(comboSono, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel14)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(campoSoniferos))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel22)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(campoAntecedentes))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel23)
                                    .addComponent(jLabel10)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                                .addComponent(jLabel15)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(comboDieta, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel16)))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(comboAutoCuidado, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel17)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(comboHigieneCorporal, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel18)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(comboHigieneOral, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel19)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(comboMovimentacao, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jLabel20))
                                .addGap(0, 3, Short.MAX_VALUE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel24)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(comboConsciencia, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel25)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(comboEstadoMental, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(checkAlucinacoes)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(campoAlucinacoes))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel26)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(comboPupilas, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel27)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(comboInteracaoSocial, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel28)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(comboDiscurso, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(checkDelirios)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(campoDelirios)))))
                .addContainerGap())
            .addComponent(jSeparator5)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel29)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel30)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(campoTemperatura, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel31)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(campoPulso, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel32)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(campoPressaoArterial, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel33)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(campoFuncaoCardiaca, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel34)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboNutricional, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel35)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboRespiratorio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel36)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboCardiaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(jLabel10)
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(campoNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4)
                    .addComponent(campoProntuário, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(campoEnfermaria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(campoLeito, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(campoNascimento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8)
                    .addComponent(campoIdade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(comboSexo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(campoProcedenca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel12)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(comboSono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14)
                    .addComponent(campoSoniferos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(comboDieta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16)
                    .addComponent(comboAutoCuidado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17)
                    .addComponent(comboHigieneCorporal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18)
                    .addComponent(comboHigieneOral, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19)
                    .addComponent(comboMovimentacao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel20)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(checkTabagismo)
                    .addComponent(checkEtilismo)
                    .addComponent(checkOutrasDrogas)
                    .addComponent(campoOutrasDrogas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel21)
                    .addComponent(campoMedicamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel22)
                    .addComponent(campoAntecedentes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel23)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel24)
                    .addComponent(comboConsciencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel25)
                    .addComponent(comboEstadoMental, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(campoAlucinacoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(checkAlucinacoes))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(comboInteracaoSocial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28)
                    .addComponent(comboDiscurso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(checkDelirios)
                    .addComponent(campoDelirios, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel26)
                    .addComponent(comboPupilas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel27))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel29)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel30)
                    .addComponent(campoTemperatura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel31)
                    .addComponent(campoPulso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel32)
                    .addComponent(campoFuncaoCardiaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel33)
                    .addComponent(campoPressaoArterial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel34)
                    .addComponent(comboNutricional, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel35)
                    .addComponent(comboRespiratorio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel36)
                    .addComponent(comboCardiaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        botaoSalvar.setText("Salvar");
        botaoSalvar.setPreferredSize(new java.awt.Dimension(81, 23));
        botaoSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoSalvarActionPerformed(evt);
            }
        });

        jButton1.setText("Cancelar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jButton1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jButton1KeyPressed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(botaoSalvar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botaoSalvar, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void comboSonoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboSonoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_comboSonoActionPerformed

    private void comboDietaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboDietaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_comboDietaActionPerformed

    private void comboAutoCuidadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboAutoCuidadoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_comboAutoCuidadoActionPerformed

    private void comboHigieneCorporalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboHigieneCorporalActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_comboHigieneCorporalActionPerformed

    private void comboHigieneOralActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboHigieneOralActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_comboHigieneOralActionPerformed

    private void comboMovimentacaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboMovimentacaoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_comboMovimentacaoActionPerformed

    private void checkTabagismoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkTabagismoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_checkTabagismoActionPerformed

    private void checkEtilismoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkEtilismoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_checkEtilismoActionPerformed

    private void comboConscienciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboConscienciaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_comboConscienciaActionPerformed

    private void comboEstadoMentalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboEstadoMentalActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_comboEstadoMentalActionPerformed

    private void comboPupilasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboPupilasActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_comboPupilasActionPerformed

    private void comboInteracaoSocialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboInteracaoSocialActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_comboInteracaoSocialActionPerformed

    private void comboDiscursoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboDiscursoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_comboDiscursoActionPerformed

    private void botaoSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoSalvarActionPerformed
        salvar();
        this.setVisible(false);
    }//GEN-LAST:event_botaoSalvarActionPerformed

    private void campoNascimentoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_campoNascimentoKeyPressed
        if(!(evt.getKeyChar() == '\b')){
            campoNascimento.setText(Formatador.formataData(campoNascimento.getText()));
        }
    }//GEN-LAST:event_campoNascimentoKeyPressed

    private void checkOutrasDrogasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkOutrasDrogasActionPerformed
        if(!this.checkOutrasDrogas.isSelected()) this.campoOutrasDrogas.setText("");
    }//GEN-LAST:event_checkOutrasDrogasActionPerformed

    private void checkDeliriosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkDeliriosActionPerformed
        if(!this.checkDelirios.isSelected()) this.campoDelirios.setText("");
    }//GEN-LAST:event_checkDeliriosActionPerformed

    private void checkAlucinacoesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkAlucinacoesActionPerformed
        if(!this.checkAlucinacoes.isSelected()) this.campoDelirios.setText("");
    }//GEN-LAST:event_checkAlucinacoesActionPerformed

    private void jButton1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jButton1KeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton1KeyPressed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        limpaCampos();
        setVisible(false);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        limpaCampos();
    }//GEN-LAST:event_formWindowClosing

    public void limpaCampos(){
        this.campoAlucinacoes.setText("");
        this.campoAntecedentes.setText("");
        this.campoDelirios.setText("");
        this.campoEnfermaria.setText("");
        this.campoFuncaoCardiaca.setText("");
        this.campoIdade.setText("");
        this.campoLeito.setText("");
        this.campoMedicamento.setText("");
        this.campoNascimento.setText("");
        this.campoNome.setText("");
        this.campoOutrasDrogas.setText("");
        this.campoPressaoArterial.setText("");
        this.campoProcedenca.setText("");
        this.campoProntuário.setText("");
        this.campoPulso.setText("");
        this.campoSoniferos.setText("");
        this.checkAlucinacoes.setSelected(false);
        this.checkDelirios.setSelected(false);
        this.checkEtilismo.setSelected(false);
        this.checkOutrasDrogas.setSelected(false);
        this.checkTabagismo.setSelected(false);
        this.comboAutoCuidado.setSelectedIndex(0);
        this.comboCardiaca.setSelectedIndex(0);
        this.comboConsciencia.setSelectedIndex(0);
        this.comboDieta.setSelectedIndex(0);
        this.comboDiscurso.setSelectedIndex(0);
        this.comboEstadoMental.setSelectedIndex(0);
        this.comboHigieneCorporal.setSelectedIndex(0);
        this.comboHigieneOral.setSelectedIndex(0);
        this.comboInteracaoSocial.setSelectedIndex(0);
        this.comboMovimentacao.setSelectedIndex(0);
        this.comboNutricional.setSelectedIndex(0);
        this.comboPupilas.setSelectedIndex(0);
        this.comboRespiratorio.setSelectedIndex(0);
        this.comboSexo.setSelectedIndex(0);
        this.comboSono.setSelectedIndex(0);
    }
    
    public void turnEditable(boolean editable){
        botaoSalvar.setEnabled(editable);
        //Ficha
        this.campoAlucinacoes.setEditable(editable);
        this.campoAntecedentes.setEditable(editable);
        this.campoDelirios.setEditable(editable);
        this.campoEnfermaria.setEditable(editable);
        this.campoFuncaoCardiaca.setEditable(editable);
        this.campoLeito.setEditable(editable);
        this.campoMedicamento.setEditable(editable);
        this.campoOutrasDrogas.setEditable(editable);
        this.campoPressaoArterial.setEditable(editable);
        this.campoProcedenca.setEditable(editable);
        this.campoPulso.setEditable(editable);
        this.campoProntuário.setEditable(false);
        this.campoSoniferos.setEditable(editable);
        this.campoTemperatura.setEditable(editable);
        this.checkAlucinacoes.setEnabled(editable);
        this.checkDelirios.setEnabled(editable);
        this.checkEtilismo.setEnabled(editable);
        this.checkOutrasDrogas.setEnabled(editable);
        this.checkTabagismo.setEnabled(editable);
        this.comboAutoCuidado.setEnabled(editable);
        this.comboCardiaca.setEnabled(editable);
        this.comboConsciencia.setEnabled(editable);
        this.comboDieta.setEnabled(editable);
        this.comboEstadoMental.setEnabled(editable);
        this.comboHigieneCorporal.setEnabled(editable);
        this.comboHigieneOral.setEnabled(editable);
        this.comboInteracaoSocial.setEnabled(editable);
        this.comboMovimentacao.setEnabled(editable);
        this.comboNutricional.setEnabled(editable);
        this.comboPupilas.setEnabled(editable);
        this.comboRespiratorio.setEnabled(editable);
        this.comboSono.setEnabled(editable);
        
        //Paciente
        this.campoIdade.setEditable(false);
        this.campoNascimento.setEditable(false);
        this.campoNome.setEditable(false);
        this.comboSexo.setEnabled(false);
    }
    
    public void preencherCampos(Paciente p, FichaHistEnfermagem he){
        this.campoAlucinacoes.setText(he.getAlucinacoes());
        this.campoAntecedentes.setText(he.getAntFami());
        this.campoDelirios.setText(he.getDelirios());
        this.campoEnfermaria.setText(he.getEnfermaria());
        this.campoFuncaoCardiaca.setText(he.getFuncCard());
        this.campoIdade.setText(DataHorario.calculaIdade(p.getDataDeNascimento()) + "");
        this.campoLeito.setText(he.getLeito() + "");
        this.campoMedicamento.setText(he.getUsoMeds());
        this.campoNascimento.setText(p.getDataDeNascimento());
        this.campoNome.setText(p.getNome() + " " + p.getSobrenome());
        this.campoOutrasDrogas.setText(he.getOutrasDrogas());
        this.campoPressaoArterial.setText(he.getPresArt());
        this.campoProcedenca.setText(he.getProcedencia());
        this.campoProntuário.setText(he.getNumeroProntuario());
        this.campoPulso.setText(he.getPulso() + "");
        this.campoSoniferos.setText(he.getAuxiliaresSono());
        this.checkAlucinacoes.setSelected(!he.getAlucinacoes().equals(""));
        this.checkDelirios.setSelected(!he.getDelirios().equals(""));
        this.checkEtilismo.setSelected(he.isEtilismo());
        this.checkOutrasDrogas.setSelected(!he.getOutrasDrogas().equals(""));
        this.checkTabagismo.setSelected(he.isTabagismo());
        MapasHistEnferm mh = MapasHistEnferm.getInstance();
        MapasPaciente mp = MapasPaciente.getInstance();
        this.comboAutoCuidado.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getDemandaAutoCuidado(),he.getDac()));
        this.comboCardiaca.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getAtivCard(),he.getAtivCard()));
        this.comboConsciencia.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getNivelConsciencia(),he.getNivConsc()));
        this.comboDieta.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getDieta(),he.getDieta()));
        this.comboDiscurso.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getDiscurso(), he.getDiscurso()));
        this.comboEstadoMental.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getEstadoMental(), he.getEstMent()));
        this.comboHigieneCorporal.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getHigieneCorp(), he.getHigCorp()));
        this.comboHigieneOral.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getHigieneOral(), he.getHigOral()));
        this.comboInteracaoSocial.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getInterSocial(), he.getInterSocial()));
        this.comboMovimentacao.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getMovimentacao(), he.getMov()));
        this.comboNutricional.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getEstadoNutricional(), he.getEstNutr()));
        this.comboPupilas.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getPupilas(), he.getPupilas()));
        this.comboRespiratorio.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getSistResp(), he.getSistResp()));
        this.comboSexo.setSelectedItem(ReverseMapper.getKeyFromValue(mp.getSexo(), p.getSexo()));
        this.comboSono.setSelectedItem(ReverseMapper.getKeyFromValue(mh.getSonoRep(), he.getSonorep()));
    }
    
    private void salvar(){
        ficha.setAlucinacoes(this.campoAlucinacoes.getText());
        ficha.setAntFami(this.campoAntecedentes.getText());
        ficha.setAtivCard((String)this.comboCardiaca.getSelectedItem());
        ficha.setAuxiliaresSono(this.campoSoniferos.getText());
        ficha.setDac((String)this.comboAutoCuidado.getSelectedItem());
        ficha.setDelirios(this.campoDelirios.getText());
        ficha.setDieta((String)this.comboDieta.getSelectedItem());
        ficha.setDiscurso((String)this.comboDiscurso.getSelectedItem());
        ficha.setEnfermaria(this.campoEnfermaria.getText());
        ficha.setEstMent((String)this.comboEstadoMental.getSelectedItem());
        ficha.setEstNutr((String)this.comboNutricional.getSelectedItem());
        ficha.setEtilismo(this.checkEtilismo.isSelected());
        ficha.setFuncCard(this.campoFuncaoCardiaca.getText());
        ficha.setHigCorp((String)this.comboHigieneCorporal.getSelectedItem());
        ficha.setHigOral((String)this.comboHigieneOral.getSelectedItem());
        ficha.setInterSocial((String)this.comboInteracaoSocial.getSelectedItem());
        ficha.setMov((String)this.comboMovimentacao.getSelectedItem());
        ficha.setNivConsc((String)this.comboConsciencia.getSelectedItem());
        ficha.setOutrasDrogas(this.campoOutrasDrogas.getText());
        ficha.setPresArt(this.campoPressaoArterial.getText());
        ficha.setProcedencia(this.campoProcedenca.getText());
        ficha.setPulso(Integer.parseInt(this.campoPulso.getText()));
        ficha.setPupilas((String)this.comboPupilas.getSelectedItem());
        ficha.setSistResp((String)this.comboRespiratorio.getSelectedItem());
        ficha.setSonorep((String)this.comboSono.getSelectedItem());
        ficha.setTabagismo(this.checkTabagismo.isSelected());
        ficha.setTemp(Double.parseDouble(this.campoTemperatura.getText()));
        ficha.setUsoMeds(this.campoMedicamento.getText());
        FichaHistEnfermagemJpaController hec = new FichaHistEnfermagemJpaController();
        try {
            hec.edit(ficha);
        } catch (NonexistentEntityException ex) {
            JOptionPane.showMessageDialog(null, "Ficha não encontrada.", "ERRO", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(TelaFichaHistoricoEnfermagem.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(null, "Erro na comunicação com o Banco de Dados.", "ERRO", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(TelaFichaHistoricoEnfermagem.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    

    public FichaHistEnfermagem getFicha() {
        return ficha;
    }

    public void setFicha(FichaHistEnfermagem ficha) {
        this.ficha = ficha;
    }   
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(TelaFichaHistoricoEnfermagem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(TelaFichaHistoricoEnfermagem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(TelaFichaHistoricoEnfermagem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(TelaFichaHistoricoEnfermagem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                TelaFichaHistoricoEnfermagem.getInstance().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botaoSalvar;
    private javax.swing.JTextField campoAlucinacoes;
    private javax.swing.JTextField campoAntecedentes;
    private javax.swing.JTextField campoDelirios;
    private javax.swing.JTextField campoEnfermaria;
    private javax.swing.JTextField campoFuncaoCardiaca;
    private javax.swing.JTextField campoIdade;
    private javax.swing.JTextField campoLeito;
    private javax.swing.JTextField campoMedicamento;
    private javax.swing.JFormattedTextField campoNascimento;
    private javax.swing.JTextField campoNome;
    private javax.swing.JTextField campoOutrasDrogas;
    private javax.swing.JTextField campoPressaoArterial;
    private javax.swing.JTextField campoProcedenca;
    private javax.swing.JTextField campoProntuário;
    private javax.swing.JTextField campoPulso;
    private javax.swing.JTextField campoSoniferos;
    private javax.swing.JTextField campoTemperatura;
    private javax.swing.JCheckBox checkAlucinacoes;
    private javax.swing.JCheckBox checkDelirios;
    private javax.swing.JCheckBox checkEtilismo;
    private javax.swing.JCheckBox checkOutrasDrogas;
    private javax.swing.JCheckBox checkTabagismo;
    private javax.swing.JComboBox comboAutoCuidado;
    private javax.swing.JComboBox comboCardiaca;
    private javax.swing.JComboBox comboConsciencia;
    private javax.swing.JComboBox comboDieta;
    private javax.swing.JComboBox comboDiscurso;
    private javax.swing.JComboBox comboEstadoMental;
    private javax.swing.JComboBox comboHigieneCorporal;
    private javax.swing.JComboBox comboHigieneOral;
    private javax.swing.JComboBox comboInteracaoSocial;
    private javax.swing.JComboBox comboMovimentacao;
    private javax.swing.JComboBox comboNutricional;
    private javax.swing.JComboBox comboPupilas;
    private javax.swing.JComboBox comboRespiratorio;
    private javax.swing.JComboBox comboSexo;
    private javax.swing.JComboBox comboSono;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JTable jTable1;
    // End of variables declaration//GEN-END:variables
    private static TelaFichaHistoricoEnfermagem instance = null;
    private FichaHistEnfermagem ficha;
}
